package com.yanqu.road.entity.rank.xrank;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.math.BigInteger;

@FieldTypeAnnotation(tableName = "t_u_xrank_user")
public class XUserRank {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "类型", select = true, update = true)
    private int conditionType;
    @FieldTypeAnnotation(desc = "排名")
    private int rank;
    @FieldTypeAnnotation(desc = "渠道ID")
    private int channelId;
    @FieldTypeAnnotation(desc = "区服ID")
    private long serverId;
    @FieldTypeAnnotation(desc = "玩家ID")
    private long userId;
    @FieldTypeAnnotation(desc = "玩家信息")
    private UserBaseInfo baseInfo;
    @FieldTypeAnnotation(desc = "拓展参数")
    private String param = "";
    @FieldTypeAnnotation(desc = "排行值")
    private BigInteger value = BigInteger.ZERO;
    @FieldTypeAnnotation(desc = "更新时间")
    private long lastUpdateTime;

    /**
     * 替换
     */
    public void replace(XUserRank tmpUserRank) {
        setActivityId(tmpUserRank.getActivityId());
        setConditionType(tmpUserRank.getConditionType());
        setChannelId(tmpUserRank.getChannelId());
        setServerId(tmpUserRank.getServerId());
        setUserId(tmpUserRank.getUserId());
        setBaseInfo(tmpUserRank.getBaseInfo());
        setValue(tmpUserRank.getValue());
        setParam(tmpUserRank.getParam());
        setLastUpdateTime(tmpUserRank.getLastUpdateTime());
    }

    public XUserRank clone() {
        XUserRank userRank = new XUserRank();
        userRank.setActivityId(getActivityId());
        userRank.setConditionType(getConditionType());
        userRank.setChannelId(getChannelId());
        userRank.setServerId(getServerId());
        userRank.setUserId(getUserId());
        userRank.setBaseInfo(getBaseInfo());
        userRank.setValue(getValue());
        userRank.setLastUpdateTime(getLastUpdateTime());
        userRank.setParam(getParam());
        return userRank;
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getConditionType() {
        return conditionType;
    }

    public void setConditionType(int conditionType) {
        this.conditionType = conditionType;
    }

    public int getChannelId() {
        return channelId;
    }

    public void setChannelId(int channelId) {
        this.channelId = channelId;
    }

    public long getServerId() {
        return serverId;
    }

    public void setServerId(long serverId) {
        this.serverId = serverId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public UserBaseInfo getBaseInfo() {
        return baseInfo;
    }

    public void setBaseInfo(UserBaseInfo baseInfo) {
        this.baseInfo = baseInfo;
    }

    public long getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(long lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public BigInteger getValue() {
        return value;
    }

    public void setValue(BigInteger value) {
        this.value = value;
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    }
}
